package com.mvc.controller;

import java.util.Arrays;

public class Xinyi {
    //学霸版
    public static void main(String[] argo) {
        int[] arr = {3, 4, 6, 7, 2, 43, 87, 24, 80, 1, 3, 2};
        int l = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] % 2 != 0) {//如果当前这个数是奇数
                //只要是奇数就往前放
                int temp = arr[l];
                arr[l] = arr[i];
                arr[i] = temp;
                l++;
            }
        }
        System.out.println(Arrays.toString(arr));
    }

}
